<template>
	<div>
		<!-- 透明的标题栏 -->
		<!-- <div class="title_bar"></div> -->
		<el-config-provider :locale="locale">
			<RouterView></RouterView>
		</el-config-provider>
	</div>
</template>

<script setup lang="ts">
import { getCurrentInstance } from 'vue';
import { computed, onMounted } from 'vue';
import { VueI18n } from 'vue-i18n';
import { RouterView } from 'vue-router';

// 计算elementplus语言
const { proxy } = getCurrentInstance()!
const locale = computed(() => {
	return (proxy?.$i18n as VueI18n).messages[proxy?.$i18n.locale!].el
})

onMounted(() => {
	// 根据 isDark 动态添加样式
	const html = document.querySelector('html')
	html!.className = JSON.parse(localStorage.getItem('dark') || 'false') ? 'dark' : ''
})
</script>

<style scoped>
/* 给标题栏添加拖拽效果 */
/* .title_bar {
	position: fixed;
	height: 30px;
	width: 100%;
	-webkit-app-region: drag;
} */
</style>